asdadsada
<?php $this->Js->buffer($this->Js->alert("dasda")); ?>

<?php echo $this->Js->domReady("asdas"); ?>
sadsadsadas
<?php echo $this->Js->writeBuffer(array(
    "inline" => true,
    "onDomReady" => false,
    "clear" => false
)); ?>

<?php debug($this->Js->getBuffer(false)); ?>

<?php echo $this->Js->writeBuffer(array(
    "inline" => true,
    "onDomReady" => false,
    "clear" => false
)); ?>

<?php $foo = array(
    "bar" => "aaa",
    "bbb" => "ccc",
    "ddd" => array(
        "eee" => "fff",
        "ggg" => "hhh"
    )
); ?>

<?php $json = $this->Js->object($foo, array(
    "prefix" => "foo",
    "postfix" => "foo"
)); ?>
<?php debug($json); ?>

<?php $this->Js->domReady("alert"); ?>